<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>模仿数组</title>
</head>
<body>
<script>
  let arr = [1, 2, 3];
  Array.prototype.push = function () {
    for (let i = 0; i < arguments.length; i++) {
      this[this.length] = arguments[i]
    }
  };
  arr.push(4, 5, 6);
  console.log(arr)
</script>
</body>
</html>
